﻿<p>
This example demonstrates how to use a template column in order to display checkboxes in Telerik Grid for ASP.NET MVC. 
</p>
<pre class="prettyprint">
&lt;% 
    int[] checkedRecords = (int[])ViewData["checkedRecords"];
    
    Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =&gt;
        {
            <em>columns.Template(o =&gt;
            {
                %&gt;
                    &lt;input name="checkedRecords" type="checkbox" value="&lt;%= o.OrderID %&gt;" 
                    &lt;% if (checkedRecords.Contains(o.OrderID)) {
                        
                        %&gt; checked="checked" &lt;%
                      } %&gt;
                   /&gt;
                &lt;%
            }).Title("Check").Width(50).HtmlAttributes(new { style = "text-align:center" });
            </em>
            columns.Bound(o =&gt; o.OrderID).Width(100);
            columns.Bound(o =&gt; o.Customer.ContactName).Width(200);
            columns.Bound(o =&gt; o.ShipAddress);
            columns.Bound(o =&gt; o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120);
        })
        .Pageable()
        .Render();
%&gt;
</pre>